﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace agvcontroller.GUI
{
    public delegate void deleExplorerPre(object sender);
    public delegate void deleExplorerNext(object sender);
    /// <summary>
    /// Interaction logic for UCExplorer.xaml
    /// </summary>
    public partial class UCExplorer : UserControl
    {
        public event deleExplorerPre onPrev;
        public event deleExplorerNext onNext;

        public string ExplorerName = string.Empty;
        string CurItem = string.Empty;

        public UCExplorer()
        {
            InitializeComponent();
        }

        public void SetName(string name)
        {
            ExplorerName = name;
        }

        private void btnPre_Click(object sender, RoutedEventArgs e)
        {
            if (onPrev != null)
                onPrev(this);
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            if (onNext != null)
                onNext(this);
        }

        public void SetCurItem(string item)
        {
            CurItem = item;
            lbCur.Content = CurItem;
        }
    }
}
